import React from 'react';
import {inject, observer} from 'mobx-react';
import { withRouter } from 'react-router-dom';
import { ListViewPage } from 'weaver-mobile-page';
import NoData from '../../public/NoData';
import MeetingUtil from '../../util/meetingUtil';

@inject('viewMeetingStore')
@withRouter
@observer
class TopicView extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
        };
      }
    componentDidMount() {
        const { getTopic } = this.props.viewMeetingStore;
        const options = {
            url: '/api/meeting/field/getMeetingTopicField',
            method: 'POST',
            params: { meetingid: this.props.meetingid,ismobile:'1' },
            type: 'json',
          };
        getTopic(options);
    }
    render() {
        const { topicList } = this.props.viewMeetingStore;
        const topicHeight = this.getHeight();
        return (
        <div style={{height:topicHeight}}>
          {
            topicList.data.length===0?<NoData/>:
            <ListViewPage.Normal
                store={topicList}
                getDataCustom={true}
                heightSpace={47}
            />
            }
            
        </div>
        )
    }

    getHeight = () => {
      return document.body.clientHeight - MeetingUtil.getTabHeight();
    }
}

export default TopicView;